package com.maxd.service.helpTask;

import com.maxd.model.HelpLuckyDetails;
import com.maxd.respository.helpTask.HelpLuckyDetailsJpaRepository;
import com.maxd.respository.helpTask.HelpLuckyDetailsRepository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

/**
 * 幸运值详细记录
 */
@Service
public class HelpLuckyDetailsServiceImpl implements IHelpLuckyDetailsService {

    private final HelpLuckyDetailsJpaRepository helpLuckyValueJpaRepository;
    private final HelpLuckyDetailsRepository helpLuckyValueRepository;

    public HelpLuckyDetailsServiceImpl(HelpLuckyDetailsJpaRepository helpLuckyValueJpaRepository, HelpLuckyDetailsRepository helpLuckyValueRepository) {
        this.helpLuckyValueJpaRepository = helpLuckyValueJpaRepository;
        this.helpLuckyValueRepository = helpLuckyValueRepository;
    }


    @Override
    public HelpLuckyDetails saveBody(HelpLuckyDetails helpLuckyDetails) {
        return helpLuckyValueJpaRepository.save(helpLuckyDetails);
    }

    @Override
    public Page<HelpLuckyDetails> selectHelpLuckyDetailsListByUserId(Pageable pageable,Long userId) {
        return helpLuckyValueRepository.selectHelpLuckyDetailsListByUserId(pageable,userId);
    }
}
